cc.Class({
    extends: cc.Component,

    properties: {
        angle:0.0,
        velocity:0.0,
    },
    randomColor(){
        return cc.color(Math.random()*155+100,Math.random()*155+100,Math.random()*155+100,255);
    },

    onLoad: function () {
        //this.angle=Math.random()*cc.macro.PI*2;   
        this.node.color=this.randomColor();
    },

    update: function (dt) {
        var a=this.angle;
        var x=Math.cos(a);
        var y=Math.sin(a);
        var s=cc.v2(x,y).mul(this.velocity*dt).add(this.node.position);
        this.node.position=s;
        var size=Global.vsize;
        var rect=cc.rect(-size.width/2,-size.height/2,size.width,size.height);
        var pos=this.node.position;
        if(!rect.contains(pos)){
            this.node.removeFromParent();
            cc.log("is remove!!");
        }
    },
});
